При работе с большими объёмами данных Python может «тормозить», особенно при обработке сотен тысяч строк или обучении сложных ML-моделей.
🎯 Ниже — два приёма, которые позволят ускорить обучение и загрузку данных в десятки раз.
1️⃣ Используйте GPU с включённым memory growth
По умолчанию TensorFlow может попытаться занять всю память видеокарты, что приводит к ошибке OOM. Решение — включить «постепенное» выделение памяти:
gpus = tf.config.experimental.list_physical_devices('GPU') if gpus: for gpu in gpus: tf.config.experimental.set_memory_growth(gpu, True)
2️⃣ Оптимизируйте загрузку данных с `tf.data`
Загрузка Excel-файла — типичное узкое место (Disk I/O). Использование tf.data.Dataset с prefetch позволяет загружать и обрабатывать данные асинхронно.
Пример:
dataset = tf.data.Dataset.from_generator( data_generator, output_signature={col: tf.TensorSpec(shape=(), dtype=tf.float32) for col in data.columns} ).shuffle(1000).batch(32).prefetch(tf.data.AUTOTUNE)
📎Вывод: GPU и tf.data с правильной настройкой дают мощный прирост производительности. Особенно важно при работе с крупными ML-пайплайнами и в продакшене.
При работе с большими объёмами данных Python может «тормозить», особенно при обработке сотен тысяч строк или обучении сложных ML-моделей.
🎯 Ниже — два приёма, которые позволят ускорить обучение и загрузку данных в десятки раз.
1️⃣ Используйте GPU с включённым memory growth
По умолчанию TensorFlow может попытаться занять всю память видеокарты, что приводит к ошибке OOM. Решение — включить «постепенное» выделение памяти:
gpus = tf.config.experimental.list_physical_devices('GPU') if gpus: for gpu in gpus: tf.config.experimental.set_memory_growth(gpu, True)
2️⃣ Оптимизируйте загрузку данных с `tf.data`
Загрузка Excel-файла — типичное узкое место (Disk I/O). Использование tf.data.Dataset с prefetch позволяет загружать и обрабатывать данные асинхронно.
Пример:
dataset = tf.data.Dataset.from_generator( data_generator, output_signature={col: tf.TensorSpec(shape=(), dtype=tf.float32) for col in data.columns} ).shuffle(1000).batch(32).prefetch(tf.data.AUTOTUNE)
📎Вывод: GPU и tf.data с правильной настройкой дают мощный прирост производительности. Особенно важно при работе с крупными ML-пайплайнами и в продакшене.
Telegram and Signal Havens for Right-Wing Extremists
Since the violent storming of Capitol Hill and subsequent ban of former U.S. President Donald Trump from Facebook and Twitter, the removal of Parler from Amazon’s servers, and the de-platforming of incendiary right-wing content, messaging services Telegram and Signal have seen a deluge of new users. In January alone, Telegram reported 90 million new accounts. Its founder, Pavel Durov, described this as “the largest digital migration in human history.” Signal reportedly doubled its user base to 40 million people and became the most downloaded app in 70 countries. The two services rely on encryption to protect the privacy of user communication, which has made them popular with protesters seeking to conceal their identities against repressive governments in places like Belarus, Hong Kong, and Iran. But the same encryption technology has also made them a favored communication tool for criminals and terrorist groups, including al Qaeda and the Islamic State.
Telegram announces Anonymous Admins
The cloud-based messaging platform is also adding Anonymous Group Admins feature. As per Telegram, this feature is being introduced for safer protests. As per the Telegram blog post, users can “Toggle Remain Anonymous in Admin rights to enable Batman mode. The anonymized admin will be hidden in the list of group members, and their messages in the chat will be signed with the group name, similar to channel posts.”
Библиотека data scientist’а | Data Science Machine learning анализ данных машинное обучение from ar